#ifndef GAME_H
#define GAME_H
#include "GameOpt.h"


class Game : public SaveLoad
{
public:
	Game(bool dummy=false); //constructor, if dummy==true, no new game dialogs is opened, just empty Game
	~Game();
	 //Printing the Game with 3 Msg Strings. if the string is "SKIP" there is no deleting of the current string 
	void PrintGame(string = "",string = "",string ="");
	char ShowMenu();//open the game Menu
	bool SetMsg(string ,unsigned int =1);//set one of the Game msgs for the user
	
	Human &getPlayer(unsigned int); //recive one object on the Player Vector
	Monster &Game::getMonster(unsigned int);//Recieve one of the Monsters on the Monsters Vector

	bool PlayerMove();  //doing the next human turn, return true if everithing done well
	bool MonsterMove();  //doing the next monster turn, return true if everithing done well
	bool CurrPlayerTurnDone() const;
	bool CurrMonsterTurnDone() const;
	bool  AddMonsters(unsigned int = 1);
	bool AddPresents(unsigned int PresentDensity);

	int fight(Entity &Attacker,Entity &Defender);
	
	int RotatePlayers();	//Rotate 'CurrentPlayer' through the actice players only
	int RotateMonsters();	//Rotate 'CurrentMonster' through the actice monsters only
	int getCurrentPlayer() const;
	int getCurrentMonster() const;

	string HaveWinner() const; //Check if there is Winner (only one living Human)

	virtual bool SaveState(ofstream &);
	virtual bool LoadState(ifstream &);
private:
	//print one Line of the player box section data. there are two modes- FullData=(T/F), and selecting the line #
	bool PrintPlayerData(unsigned int PlayerNum,unsigned int LineNum,bool FullData = false) const;
	//Print one Line of the Msgs box section
	bool PrintMsg(unsigned int LineNum) const;

	Maze GameMaze;
	
	vector<Monster> Monsters;	//vector of the playes on the board
	vector<Human> Players;		//vector of the monsters on the board
	int CurrentPlayer;			//the number of the currnet player (indexed), -1 if the Players rounds hasnt started
	int CurrentMonster;			//the number of the currnet Monster (indexed), -1 if the monsters round hasnt started
	string Msg[3];				//3 strings of massegs for the user. can be changed on the PrintGame() or by SetMsg() funcs
};
#endif
